from io import BytesIO

from asgiref.sync import sync_to_async
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.db import transaction
from openai import OpenAI

from llm.models import Files


class FilesDAO:
    @classmethod
    def add(cls, file_id, file_name, file_size) -> Files:
        return Files.objects.create(file_id=file_id, file_name=file_name, file_size=file_size)
